Optimal. Leaf size=151 \[ -\frac {5 a^4 (A+2 B) \sin (c+d x)}{2 d}+\frac {a^4 (13 A+12 B) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {(9 A+11 B) \sin (c+d x) \left (a^4 \sec (c+d x)+a^4\right )}{3 d}+a^4 x (4 A+B)+\frac {(A+2 B) \sin (c+d x) \left (a^2 \sec (c+d x)+a^2\right )^2}{2 d}+\frac {a B \sin (c+d x) (a \sec (c+d x)+a)^3}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.37, antiderivative size = 151, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 3, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {4018, 3996, 3770} \[ -\frac {5 a^4 (A+2 B) \sin (c+d x)}{2 d}+\frac {a^4 (13 A+12 B) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {(A+2 B) \sin (c+d x) \left (a^2 \sec (c+d x)+a^2\right )^2}{2 d}+\frac {(9 A+11 B) \sin (c+d x) \left (a^4 \sec (c+d x)+a^4\right )}{3 d}+a^4 x (4 A+B)+\frac {a B \sin (c+d x) (a \sec (c+d x)+a)^3}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3770
Rule 3996
Rule 4018
Rubi steps
\begin {align*} \int \cos (c+d x) (a+a \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx &=\frac {a B (a+a \sec (c+d x))^3 \sin (c+d x)}{3 d}+\frac {1}{3} \int \cos (c+d x) (a+a \sec (c+d x))^3 (a (3 A-B)+3 a (A+2 B) \sec (c+d x)) \, dx\\ &=\frac {a B (a+a \sec (c+d x))^3 \sin (c+d x)}{3 d}+\frac {(A+2 B) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 d}+\frac {1}{6} \int \cos (c+d x) (a+a \sec (c+d x))^2 \left (a^2 (3 A-8 B)+2 a^2 (9 A+11 B) \sec (c+d x)\right ) \, dx\\ &=\frac {a B (a+a \sec (c+d x))^3 \sin (c+d x)}{3 d}+\frac {(A+2 B) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 d}+\frac {(9 A+11 B) \left (a^4+a^4 \sec (c+d x)\right ) \sin (c+d x)}{3 d}+\frac {1}{6} \int \cos (c+d x) (a+a \sec (c+d x)) \left (-15 a^3 (A+2 B)+3 a^3 (13 A+12 B) \sec (c+d x)\right ) \, dx\\ &=-\frac {5 a^4 (A+2 B) \sin (c+d x)}{2 d}+\frac {a B (a+a \sec (c+d x))^3 \sin (c+d x)}{3 d}+\frac {(A+2 B) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 d}+\frac {(9 A+11 B) \left (a^4+a^4 \sec (c+d x)\right ) \sin (c+d x)}{3 d}-\frac {1}{6} \int \left (-6 a^4 (4 A+B)-3 a^4 (13 A+12 B) \sec (c+d x)\right ) \, dx\\ &=a^4 (4 A+B) x-\frac {5 a^4 (A+2 B) \sin (c+d x)}{2 d}+\frac {a B (a+a \sec (c+d x))^3 \sin (c+d x)}{3 d}+\frac {(A+2 B) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 d}+\frac {(9 A+11 B) \left (a^4+a^4 \sec (c+d x)\right ) \sin (c+d x)}{3 d}+\frac {1}{2} \left (a^4 (13 A+12 B)\right ) \int \sec (c+d x) \, dx\\ &=a^4 (4 A+B) x+\frac {a^4 (13 A+12 B) \tanh ^{-1}(\sin (c+d x))}{2 d}-\frac {5 a^4 (A+2 B) \sin (c+d x)}{2 d}+\frac {a B (a+a \sec (c+d x))^3 \sin (c+d x)}{3 d}+\frac {(A+2 B) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 d}+\frac {(9 A+11 B) \left (a^4+a^4 \sec (c+d x)\right ) \sin (c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 6.48, size = 1202, normalized size = 7.96 \[ \text {result too large to display} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.46, size = 159, normalized size = 1.05 \[ \frac {12 \, {\left (4 \, A + B\right )} a^{4} d x \cos \left (d x + c\right )^{3} + 3 \, {\left (13 \, A + 12 \, B\right )} a^{4} \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (13 \, A + 12 \, B\right )} a^{4} \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (6 \, A a^{4} \cos \left (d x + c\right )^{3} + 8 \, {\left (3 \, A + 5 \, B\right )} a^{4} \cos \left (d x + c\right )^{2} + 3 \, {\left (A + 4 \, B\right )} a^{4} \cos \left (d x + c\right ) + 2 \, B a^{4}\right )} \sin \left (d x + c\right )}{12 \, d \cos \left (d x + c\right )^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.80, size = 227, normalized size = 1.50 \[ \frac {\frac {12 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1} + 6 \, {\left (4 \, A a^{4} + B a^{4}\right )} {\left (d x + c\right )} + 3 \, {\left (13 \, A a^{4} + 12 \, B a^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (13 \, A a^{4} + 12 \, B a^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (21 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 30 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 48 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 76 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 27 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 54 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3}}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 1.33, size = 189, normalized size = 1.25 \[ \frac {A \,a^{4} \sin \left (d x +c \right )}{d}+a^{4} B x +\frac {a^{4} B c}{d}+4 A \,a^{4} x +\frac {4 A \,a^{4} c}{d}+\frac {6 a^{4} B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {13 A \,a^{4} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d}+\frac {20 a^{4} B \tan \left (d x +c \right )}{3 d}+\frac {4 A \,a^{4} \tan \left (d x +c \right )}{d}+\frac {2 a^{4} B \sec \left (d x +c \right ) \tan \left (d x +c \right )}{d}+\frac {A \,a^{4} \sec \left (d x +c \right ) \tan \left (d x +c \right )}{2 d}+\frac {a^{4} B \tan \left (d x +c \right ) \left (\sec ^{2}\left (d x +c \right )\right )}{3 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.35, size = 235, normalized size = 1.56 \[ \frac {48 \, {\left (d x + c\right )} A a^{4} + 4 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B a^{4} + 12 \, {\left (d x + c\right )} B a^{4} - 3 \, A a^{4} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, B a^{4} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 36 \, A a^{4} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 24 \, B a^{4} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 12 \, A a^{4} \sin \left (d x + c\right ) + 48 \, A a^{4} \tan \left (d x + c\right ) + 72 \, B a^{4} \tan \left (d x + c\right )}{12 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.10, size = 254, normalized size = 1.68 \[ \frac {A\,a^4\,\sin \left (c+d\,x\right )}{d}+\frac {8\,A\,a^4\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {13\,A\,a^4\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,B\,a^4\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {12\,B\,a^4\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {4\,A\,a^4\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}+\frac {A\,a^4\,\sin \left (c+d\,x\right )}{2\,d\,{\cos \left (c+d\,x\right )}^2}+\frac {20\,B\,a^4\,\sin \left (c+d\,x\right )}{3\,d\,\cos \left (c+d\,x\right )}+\frac {2\,B\,a^4\,\sin \left (c+d\,x\right )}{d\,{\cos \left (c+d\,x\right )}^2}+\frac {B\,a^4\,\sin \left (c+d\,x\right )}{3\,d\,{\cos \left (c+d\,x\right )}^3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ a^{4} \left (\int A \cos {\left (c + d x \right )}\, dx + \int 4 A \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 6 A \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int 4 A \cos {\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int A \cos {\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}\, dx + \int B \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 4 B \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int 6 B \cos {\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int 4 B \cos {\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}\, dx + \int B \cos {\left (c + d x \right )} \sec ^{5}{\left (c + d x \right )}\, dx\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________